<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>处方列表</title>
</head>
<body>
<h1>处方列表</h1>
<form action="" method="post">
    {% csrf_token %}
    <input type="text" name="cname">
    <input type="submit" value="搜索">
    <a href="{% url 'user:add_ption' %}"><input type="button" value="新增"></a>
</form>
<table border="1">
    <tr>
        <td>序号</td>
        <td>处方名称</td>
        <td>诊断结果</td>
        <td>诊断医生</td>
        <td>患者</td>
        <td>操作</td>
    </tr>
    {% for i in listl %}
    <tr>
        <td>{{ i.id }}</td>
        <td>{{ i.cname }}</td>
        <td>{{ i.result }}</td>
        <td>{{ i.doctor.truename }}</td>
        <td>{{ i.hname }}</td>
        <td><a href="{% url 'user:delp' i.id %}">删除</a>&nbsp;<a href="{% url 'user:update' i.id %}">修改</a></td>
    </tr>
    {% endfor %}
    
</table>
<a href="{% url 'user:showp' %}?page={{ page|add:-1 }}&cname={{ cname }}">上一页</a>
<a href="#">当前页{{ page }}</a>
<a href="{% url 'user:showp' %}?page={{ page|add:1 }}&cname={{ cname }}">下一页</a>
</body>
</html>